<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="resources/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
	$(function() {
	    $( ".datepicker" ).datepicker();
	});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Nuevo Torneo</title>
</head>
<body>
	<form method="POST" action="NuevoTorneo" onsubmit="check()" >
		<table>
			<tr>
				<td>
					Nombre: 
				</td>
				<td>
					<input class="inputs" type="text" name="nombre" />
				</td>
			</tr>
			<tr>
				<td>
					Descripcion: 
				</td>
				<td>
					<input class="inputs" type="text" name="descripcion" />
				</td>
			</tr>
			<tr>
				<td>
					Inicio:
				</td>
				<td>
					<input class="datepicker inputs" type="text" name="fechaInicio" />
				</td>
			</tr>
		</table>
		<input type="submit" value="Aceptar" />
	</form>

</body>
<script>
	function check(){
		var inputs = document.getElementsByClassName('inputs');
		for(var i = 0; i < inputs.length ; i++){
			if(!inputs[i].value){
				alert('Debes completar todos los campos');
				return false;
			}
		}
		return true;
	}
</script>
</html>